<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />	
</h:head>
<h:body>
	<ui:composition template="template.xhtml">

		<ui:define name="title">mehmet emmy</ui:define>
		<ui:define name="body">

			<h:form id="yazilimAramaListelemeForm">
				<c:choose>
					<c:when test="${sessionScope.currentYazList != null}">
						<c:choose>
							<c:when test="#{sessionScope.currentFirma != null}">
								<p:commandButton id="getAllListButton" value="Firma Seçimini Kaldır"
									actionListener="#{aygitBean.restart}" 
									update=":urunAramaForm" /> <!-- -değiştir -->
								
								<p:commandButton id="urunListButton" value="Şirket Yazılım Listesine Git"
									actionListener="#{aygitBean.
										getUreticiAygitlari(sessionScope.deleteAygitToContext)}"
									update=":urunAramaForm" />	
							</c:when>
							<c:otherwise>
								<p:commandButton id="urunListButton" value="Yazılım Listesine Git"
									actionListener="#{aygitBean.restart}" 
									update=":urunAramaForm" />	<!-- aygıt yazılımları bean i kullan -->
							</c:otherwise>
						</c:choose>
					
					
					
						<p:commandButton id="yazilimListButton" value="Yazılım Listesine Git"
							actionListener="#{aygitYazilimlariBean.deleteYzlToContext}"
							update=":yazilimAramaListelemeForm" />
						<c:if test="#{sessionScope.currentFirma =='evet'}">
							<p:commandButton id="getAllListButton" value="Firma Seçimini Kaldır"
								actionListener="#{aygitBean.restart}"
								update=":yazilimAramaListelemeForm" />
						</c:if> 					
									
					</c:when>
					<c:otherwise>

						<p:dataTable id="yzlAramaTable" var="yazilim"
							value="#{aygitYazilimlariBean.aygitYazilimList}" widgetVar="yazilimlarTable"
							resizableColumns="true"
							emptyMessage="No software found with given criteria"
							rowKey="#{yazilim.aygitYazid}"
							selection="#{sessionScope.currentAygitYzl}"
							selectionMode="single" paginator="true" rows="10" liveScroll="true">

							<p:ajax event="rowSelect" listener="#{aygitYazilimlariBean.deleteYzlToContext}"
								update=":yazilimAramaListelemeForm" />

							<f:facet name="header">
								<p:outputPanel>
									<h:outputText value="Search all fields:" />
									<p:inputText id="globalFilter" onkeyup="yazilimlarTable.filter()"
										style="width:150px" />
								</p:outputPanel>
							</f:facet>
					<!-- 		<c:choose>
								<c:when test="{yazilim.aygit.aygitTuru=='BELLEK'}">
									<p:column id="yzAygtMarkaColumn"
										filterBy="uymm" headerText="Ürün model"
										footerText="startsWith">
										<h:outputText id="uymm" value="#{yazilim.aygit.bellekler.marka} , #{yazilim.aygit.bellekler.model}" />
									</p:column>
								</c:when>
							</c:choose>
							-->
							<p:column id="yzlidColumn" filterBy="#{yazilim.aygitYazid}"
								headerText="Yazılım ID" footerText="contains"
								filterMatchMode="contains">
								<h:outputText value="#{yazilim.aygitYazid}" />
							</p:column>

						<!-- 	<p:column id="modelColumn" filterBy="#{urun.model}"
								headerText="Model" footerText="contains"
								filterMatchMode="contains">
								<h:outputText value="#{urun.model}" />
							</p:column>

							<p:column id="markaColumn" filterBy="#{urun.marka}"
								headerText="Marka" footerText="contains"
								filterMatchMode="contains">
								<h:outputText value="#{urun.marka}" />
							</p:column>   -->
						</p:dataTable>

					</c:otherwise>
				</c:choose>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>